﻿using J.Model;
using J.ProductGet.Application.Command.PriceInventoryControlCommand;
using MediatR;
using SqlSugar;

namespace J.ProductGet.Application.CommandHandler.PriceInventoryControlCommandHandler
{
    public class PriceInventoryControlGetCommandHandler : IRequestHandler<PriceInventoryControlGetCommand, List<PriceInventoryControl>>
    {
        private readonly ISqlSugarClient _sqlSugarClient;
        public PriceInventoryControlGetCommandHandler(ISqlSugarClient sqlSugarClient)
        {
            _sqlSugarClient = sqlSugarClient;
        }
        public async Task<List<PriceInventoryControl>> Handle(PriceInventoryControlGetCommand request, CancellationToken cancellationToken)
        {
            return await _sqlSugarClient.Queryable<PriceInventoryControl>().ToListAsync();
        }
    }
}
